<html>
<head>
  <title>Post-session Wrap-up</title>
  <%= render :partial => "style" %>
</head>
<body>

<p>Hi there <%= reservation.user.name %>,</p>

<div class="followup">
  <p>
    <%- if reservation.attended? -%>
      Congratulations on completing the recent class "<%= reservation.session.topic.name %>".
    <%- else -%>
      Our records show that you were registered for the recent class "<%= reservation.session.topic.name %>".
    <%- end -%>
    <%- if reservation.need_survey? -%>
      Now that the class has concluded, we'd love to get your feedback!
    <%- end -%>
  </p>

  <%- if reservation.need_survey? -%>
    <%- if reservation.session.topic.survey_type == Topic::SURVEY_INTERNAL -%>
      <p>We've prepared a very quick, 5 question survey that won't take more than 3 minutes of your time --
        we promise! Please <a href="<%= url_for :controller => "survey_responses", :action => "new", :only_path => false %>?reservation_id=<%= reservation.id %>">click here</a> to take the survey, and accept our thanks.</p>
    <%- elsif reservation.session.topic.survey_type == Topic::SURVEY_EXTERNAL -%>  
      <p>The instructor for this course has set up a survey to collect feedback on this course. Please
        <a href="<%=h reservation.session.topic.survey_url%>">click here</a> 
        to complete the survey if you haven't already done so. Thank you!</p>
    <%- end -%>
  <%- end -%>

  <%- if reservation.session.topic.certificate? -%>
    <p>
      <%- if reservation.attended? -%>
        <%- if reservation.need_survey? -%>
          After completing the survey, be sure to 
        <%- else -%>
          You can now 
        <%- end -%>
      <%- else -%>
          Once the instructor records attendance, you will be able to 
      <%- end -%>
      download your certificate of completion from the 
      <%= link_to "Your Reservations", :controller => "reservations", :only_path => false %> page!
    </p>
  <%- end -%>

  <p>
    <%- if reservation.need_survey? -%>
      Thanks in advance for your feedback!
    <%- end -%>
    We really hope you enjoyed the class. To find more classes offered by 
    <%= reservation.session.topic.department.name %> or other departments,
    check out the list of upcoming sessions <%= link_to "here", root_url %>.
  </p>

</div>
</body>
</html>
